<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加字段 - Powered By BETOU.NET</title>
<meta name="author" content="BETOU.NET Team" />
<meta name="copyright" content="BETOU.NET" />
<link href="${base}/res/betou/css/common.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="${base}/res/common/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${base}/res/betou/js/jquery.tools.js" ></script>
<script type="text/javascript" src="${base}/res/betou/js/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/res/common/js/common.js"></script>
<script type="text/javascript" src="${base}/res/betou/js/input.js"></script>

<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	var $dataType = $("#dataType");
	
	// 表单验证
	$inputForm.validate({
		rules: {
			field:{required:true},
			label: {required:true},
			priority:{required:true, digits:true}
		}
	});
	
	$dataType.change( function( ){
		var value = $(this).val();
		if( value == 6 || value == 7 || value == 8){
			$("#optValueTr").show();
		}else{
			$("#optValueTr").hide();
		}
	});
});
</script>
</head>
<body>
	<div class="path">
		<a href="../right.do">首页</a> &raquo; <#if isChannel><a href="v_list.do?modelId=${modelId}&isChannel=${isChannel?string('true','false')}"><@s.m "cmsModel.modelChannel"/></a><#else><@s.m "cmsModel.modelContent"/></#if> &raquo; <@s.m "global.add"/>
	</div>
	<form id="inputForm" action="o_save.do" method="post">
		<input type="hidden" name="modelId" value="${modelId}"/>
		<input type="hidden" name="channel" value="${isChannel?string("true","false")}"/>
		<table class="input">
			<tr>
				<th>
					<span class="requiredField">*</span><@s.m "cmsModelItem.field"/>:
				</th>
				<td>
					<input type="text"  name="field" id="field" class="text" maxlength="50" />	 
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span><@s.m "cmsModelItem.label"/>:
				</th>
				<td>
					<input type="text"  id="label" name="label" class="text" maxlength="100" />	 
				</td>
			</tr>
			<tr>
				<th>
					<span class="requiredField">*</span><@s.m "cmsModelItem.priority"/>:
				</th>
				<td>
					<input type="text"  id="priority" name="priority" class="text" maxlength="5"  value="20"/>	 
				</td>
			</tr>
			<tr>
				<th><@s.m "cmsModelItem.dataType"/>:</th>
				<td>
					<select name="dataType" id="dataType">
						<option value="1"><@s.m "cmsModelItem.type1"/></option>
						<option value="2"><@s.m "cmsModelItem.type2"/></option>
						<option value="3"><@s.m "cmsModelItem.type3"/></option>
						<option value="4"><@s.m "cmsModelItem.type4"/></option>
						<option value="5"><@s.m "cmsModelItem.type5"/></option>
						<option value="6"><@s.m "cmsModelItem.type6"/></option>
						<option value="7"><@s.m "cmsModelItem.type7"/></option>
						<option value="8"><@s.m "cmsModelItem.type8"/></option>
					</select>
				</td>
			</tr>
			<tr>
				<th>
					<@s.m "cmsModelItem.help"/>:
				</th>
				<td>
					<input type="text"  id="help" name="help" class="text" maxlength="100"  title="该字段的提示信息"/>	 
				</td>
			</tr>
			<tr>
				<th><@s.m "cmsModelItem.defValue"/>:</th>
				<td><input type="text"  id="defValue" name="defValue" class="text" maxlength="255"  title="该字段的默认值"/>	 </td>
			</tr>
			<tr id="optValueTr" style="display:none">
				<th><@s.m "cmsModelItem.optValue"/>:</th>
				<td>
					<input type="text" class="text" name="optValue" id="optValue" maxlength="255"  style="width:300px;" title="多个值用英文','号分开" />
				</td>
			</tr>
			<tr>
				<th>
					&nbsp;
				</th>
				<td>
					<input type="submit" class="button" value="确&nbsp;&nbsp;定" />
					<input type="button" class="button" value="返&nbsp;&nbsp;回" onclick="location.href='v_list.do'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>